package com.sdi.columbus;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class AssetListActivity extends ListActivity {
	
	    Intent in;
	    Bundle b;
	    GpsData gpsd=new GpsData();
		
	    String[] regno=null;
	    String[] vname=null;
	    String[] vehname=new String[0];
	    String[] vehmake=new String[0];
	    String[] vehregno=new String[0];
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		 regno = new String[gpsd.getSize()];
		 vname = new String[gpsd.getSize()];
		 
		 regno=gpsd.getVehicleRegNo();
		 vname=gpsd.getVehicleModel();
	
		setListAdapter(new AssetList(this, vname));

	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {

		//get selected items
		String selectedValue = (String) getListAdapter().getItem(position);
		//Toast.makeText(this, selectedValue, Toast.LENGTH_SHORT).show();
		in=new Intent(AssetListActivity.this,DisplayAsset.class);
		b=new Bundle();
		b.putInt("argid",position);
		in.putExtras(b);
		startActivity(in);

	}

}
